function* gen(x) {
  console.log(22);

  let y = yield x + 2;
  console.log(y);
  return y;
}
let g = gen(1);
console.log(g.next()); // { value: 3, done: false }
console.log(g.next(2)); // { value: undefined, done: true }
console.log(g.next());
